<%@page contentType="text/html" pageEncoding="ISO-8859-1"%>
<%@page import="com.gn.mporras.dao.*" %>
<%@page import="com.gn.mporras.model.*" %>
<%@page import="java.util.*"%>
<%@page import="java.math.BigDecimal"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>JSP Page</title>
  </head>
  <body>
    <%
              /*
              // Insert one invoice
              FacturaDAOImpl facDAO = new FacturaDAOImpl(null);

              Factura fac = new Factura();
              fac.setFacturaid(String.valueOf(System.currentTimeMillis()).substring(9));
              fac.setFecha(new Date(System.currentTimeMillis()));
              fac.setFechapago(new Date(System.currentTimeMillis()));
              fac.setPagado(false);
              fac.setSaldo(new BigDecimal(8));
              fac.setVendedorid("888");

              facDAO.insert(fac);
              out.print(fac.getFacturaid());
               */

              /*
              // Select all invoices
              List<Factura> facts = facDAO.selectByExample(null);
              out.print(facts.size());
               */

              /*
              // Select some products by example
              ProductoExample proExa = new ProductoExample();
              ProductoDAOImpl proDAO = new ProductoDAOImpl(null);

              proExa.createCriteria().andProductoidEqualTo("AFAP001").andPuntosGreaterThan(100);
              proExa.or(proExa.createCriteria().andProductoidEqualTo("AFAP002"));
              out.print(proDAO.selectByExample(proExa).size());
               */

              /*
              // Update one product
              Producto producto = new Producto();
              ProductoDAOImpl proDAO = new ProductoDAOImpl(null);

              producto.setProductoid("AFAP001");
              producto.setNombre("1611");
              producto.setPuntos(16);

              out.print(proDAO.updateByPrimaryKey(producto)+" products updated");
               */

              VendedorDAOImplCustom venDAO = new VendedorDAOImplCustom(null);
              out.print(venDAO.getSumPremiosPuntos("24995896")+"<br/>");
              HashMap map = venDAO.getPuntosDistribuidorId("24995896");

              for (Integer i = 1; i <= map.size(); i++) {
                out.print(map.get(i.toString())+" ");
              }
    %>
  </body>
</html>